<template>
    <div class="icontext">
        <img class="icon" :src="icon" >
        <span class="text">{{text}}</span>
    </div>
</template>

<script>
    // 搜索组件
    export default {
        name: 'icontext',
        props: {
            text:{
                type:String,
                default:''
            },
            icon: { //图标地址
                type: String,
                default: ''
            }
        },
        data() {
            return {
                name: 'icontext',
            }
        },
        watch: { //嵌套过深的对象无法监听除非深度监听 耗性能不推荐 不知是否是存在数组的问题 最好发新的整个对象过来
        },
        methods: {},
        // computed:{
        // },
        mounted() {
            //组件挂载后
        },
        updated() {
            //数据更新后
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
    .icontext {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .icontext .icon {
        width: 1.5rem;
        height: 1.5rem;
        display: block;
    }
    .icontext .text {
        display: block;
        font-size: 0.66rem;
        line-height: 1;
        margin-top: 0.25rem;
        color: #212121;
    }
</style>
